Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare counter variable in for statements #224

Merged
merged 1 commit into from Mar 27, 2019
Merged

Declare counter variable in for statements #224

merged 1 commit into from Mar 27, 2019

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Mar 23, 2019

Declaring the counter variable outside the for statement is done very rarely in actual programming, and only when there is a use for that variable outside the scope of the for loop (which is not the case here). I don't see any value in declaring the variable outside the statement in the example code, as it only teaches bad programming. In some cases, the example code snippets didn't even contain a declaration and so would not compile if copied into a sketch.

Fixes #218

Declaring the counter variable outside the for statement is done very rarely in actual programming, and only when there is a use for that variable outside the scope of the for loop (which is not the case here). I don't see any value in declaring the variable outside the statement in the example code, as it only teaches bad programming. In some cases, the example code snippets didn't even contain a declaration and so would not compile if copied into a sketch.
@SeppPenner SeppPenner merged commit 37f2763 into arduino:master Mar 27, 2019
@per1234 per1234 deleted the declare-counter-variable-in-for branch March 27, 2019 07:58
@SeppPenner SeppPenner self-assigned this Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants